package io.finer.erp.jeecg.bas.service.impl;

import io.finer.erp.jeecg.bas.entity.BasInventorySheet;
import io.finer.erp.jeecg.bas.mapper.BasInventorySheetMapper;
import io.finer.erp.jeecg.bas.service.IBasInventorySheetService;

import java.util.List;

import org.jeecg.common.system.api.ISysBaseAPI;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

/**
 * @Description: 盘点单
 * @Author: jeecg-boot
 * @Date:   2021-08-16
 * @Version: V1.0
 */
@Service
public class BasInventorySheetServiceImpl extends ServiceImpl<BasInventorySheetMapper, BasInventorySheet> implements IBasInventorySheetService {

	@Autowired
	private ISysBaseAPI baseApi;

	@Override
	public boolean saveSheet() {
		// TODO Auto-generated method stub
		String code = baseApi.getNoByCode("check_code");
		BasInventorySheet sheet = new BasInventorySheet();
		sheet.setCode(code);
		return this.save(sheet);
	}

	@Override
	public List<BasInventorySheet> getNotCounted() {
		// TODO Auto-generated method stub
		LambdaQueryWrapper<BasInventorySheet> queryWrapper = new LambdaQueryWrapper<>();
		queryWrapper.eq(BasInventorySheet::getStatus, "0");
		return this.list(queryWrapper);
	}
	
}
